<?php
ob_start();
session_start();


//error_reporting(0); //hide error or warning
try{
    include_once('restconnection.php');
         
    if(isset($client)){  
        

        //retrive base url 
        $url = $_SESSION['basic_url'];
        //add service url
        $service_url="/N_Liker?";
        
        $params = array('id'=>$_SESSION['id'],'service'=>'Facebook'); 
        //params connection
        $ctx = stream_context_create(array('http' => array('timeout' => 5))); 
        
        //send GET request
       // print_r($url.$service_url."id=".$params['id']); break;
        $output = @file_get_contents($url.$service_url."id=".$_SESSION['id']."&"."service=".$params['service'],0,$ctx);
        
        //print_r($url.$service_url."id=".$_SESSION['id']."&"."service=".$params['service']); break;
        //parse JSON output
        $data = json_decode($output);
        //print_r($data); break;
        $webResult = $data->N_LikerResult;
        $params = array('id'=>$_SESSION['id'],'service'=>'Twitter'); 
        //params connection
        
        //send GET request
       // print_r($url.$service_url."id=".$params['id']); break;
        $output = @file_get_contents($url.$service_url."id=".$_SESSION['id']."&"."service=".$params['service'],0,$ctx);
        
        //print_r($url.$service_url); break;
        //parse JSON output
        $data = json_decode($output);
        //print_r($data); break;
        $webResult = $data->N_LikerResult;
        
        
        $params = array('id'=>$_SESSION['id'],'service'=>'Google'); 
        //params connection
        
        //send GET request
       // print_r($url.$service_url."id=".$params['id']); break;
        $output = @file_get_contents($url.$service_url."id=".$_SESSION['id']."&"."service=".$params['service'],0,$ctx);
        
        //print_r($url.$service_url); break;
        //parse JSON output
        $data = json_decode($output);
        //print_r($data); break;
        $webResult = $data->N_LikerResult;
        
        
        
        
        if($webResult==true){
            
    ?>
   <!-- <div class="server"><label>Server Status:</label><label class="green">Update Ok</label></div>
    <div class="spacer"> </div> -->
    
    <?php  
    
        }else{
            ?>
    <!--<div class="server"><label>Server Status:</label><label class="red">Not Update</label></div>
    <div class="spacer"> </div>    <div class="spacer"> </div> -->

    <?php
         }  
     
    }
}catch(Exception $e){
    
    //echo $e->getMessage(); 

}    
?>